import React from 'react'
import './Cart.css'
import { useDispatch, useSelector } from 'react-redux'
import { addnum } from '../../store/hzyCart/hzyCart'
export default function Cart() {
    const { num } = useSelector((store) => { return store.hzyCart })
    const dispatch = useDispatch()
    return (
        <div className='cart'>
            <span>gouwuche</span>
            <span>{num}</span>
            <button onClick={() => { dispatch(addnum({ num: 1 })) }}>++</button>
        </div>
    )
}
